<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/vue.js"></script>
</head>

<body>
    <!-- <input type="button" value="点击按钮" id="btn">
    <script>
        document.getElementById("btn").onclick=function() {
            alert('传统点击按钮事件')
        }
    </script> -->
    <div id="app">
        <input type="button" :value="btnValue" v-on:click="click">
    </div>

    <script>
        var vm = new Vue({
            el: "#app",
            data: {
                btnValue: "点击一下吧"
            },
            methods: {
                click: function () {
                    alert('hha')
                }
            },
        })
        //将v-on的代码直接写在语句中是错误的，必须要定义相对应的时间，否则会报错

    </script>


</body>

</html>